#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int DigitSum(int n) {
	int sum = 0;
	while (n > 0) {
		sum += n % 10;
		n /= 10;
	}
	return sum;

}
int main()
{
	int n = 0;
	scanf("%d", &n);
	int i=DigitSum(n);
	printf("%d", i);
	return 0;
}